package com.chen.q2.annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(WebConfiguration.class)
@EnableConfigurationProperties(WebConfProperties.class)
public class WebAutoConfiguration {

    @Autowired
    WebConfiguration webConfiguration;
    @Autowired
    WebConfProperties webConfProperties;

    @Bean
    public WebInfo getWebInfo(){
        return new WebInfo(webConfiguration.getName() + "-" + webConfProperties.getPa());
    }
}
